home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / geometry / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  4.2 KB  |  153 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Geometry"
  4.    ClientHeight    =   4635
  5.    ClientLeft      =   1530
  6.    ClientTop       =   795
  7.    ClientWidth     =   6480
  8.    Height          =   5325
  9.    Left            =   1470
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4635
  13.    ScaleWidth      =   6480
  14.    Top             =   165
  15.    Width           =   6600
  16.    Begin CommandButton Command2 
  17.       Caption         =   "Cancel"
  18.       Height          =   375
  19.       Left            =   4440
  20.       TabIndex        =   12
  21.       Top             =   4080
  22.       Width           =   1815
  23.    End
  24.    Begin CommandButton Command1 
  25.       Caption         =   "OK"
  26.       Height          =   375
  27.       Left            =   4440
  28.       TabIndex        =   7
  29.       Top             =   3600
  30.       Width           =   1815
  31.    End
  32.    Begin TextBox Area 
  33.       Height          =   375
  34.       Left            =   3120
  35.       TabIndex        =   11
  36.       Top             =   2880
  37.       Width           =   2415
  38.    End
  39.    Begin TextBox Semi 
  40.       Height          =   375
  41.       Left            =   3120
  42.       TabIndex        =   9
  43.       Top             =   2280
  44.       Width           =   2415
  45.    End
  46.    Begin TextBox SideC 
  47.       Height          =   375
  48.       Left            =   4800
  49.       TabIndex        =   6
  50.       Text            =   "5"
  51.       Top             =   1320
  52.       Width           =   975
  53.    End
  54.    Begin TextBox SideB 
  55.       Height          =   375
  56.       Left            =   2640
  57.       TabIndex        =   5
  58.       Text            =   "4"
  59.       Top             =   1320
  60.       Width           =   975
  61.    End
  62.    Begin TextBox SideA 
  63.       Height          =   375
  64.       Left            =   360
  65.       TabIndex        =   2
  66.       Text            =   "3"
  67.       Top             =   1320
  68.       Width           =   975
  69.    End
  70.    Begin Label Label6 
  71.       Caption         =   "Area of Triangle:"
  72.       Height          =   255
  73.       Left            =   360
  74.       TabIndex        =   10
  75.       Top             =   3000
  76.       Width           =   2415
  77.    End
  78.    Begin Label Label5 
  79.       Caption         =   "Semi Perimiter of Triangle:"
  80.       Height          =   255
  81.       Left            =   360
  82.       TabIndex        =   8
  83.       Top             =   2400
  84.       Width           =   2415
  85.    End
  86.    Begin Label Label4 
  87.       Caption         =   "Side C:"
  88.       Height          =   255
  89.       Left            =   4800
  90.       TabIndex        =   4
  91.       Top             =   840
  92.       Width           =   735
  93.    End
  94.    Begin Label Label3 
  95.       Caption         =   "Side B:"
  96.       Height          =   255
  97.       Left            =   2640
  98.       TabIndex        =   3
  99.       Top             =   840
  100.       Width           =   735
  101.    End
  102.    Begin Label Label2 
  103.       Caption         =   "Side A:"
  104.       Height          =   255
  105.       Left            =   360
  106.       TabIndex        =   1
  107.       Top             =   840
  108.       Width           =   735
  109.    End
  110.    Begin Label Label1 
  111.       Caption         =   "ENTER THE THREE SIDES OS A TRIANGLE:"
  112.       Height          =   255
  113.       Left            =   360
  114.       TabIndex        =   0
  115.       Top             =   240
  116.       Width           =   4455
  117.    End
  118.    Begin Menu MenExit 
  119.       Caption         =   "E&xit"
  120.    End
  121. Sub Command1_Click ()
  122. ''''''''''''''''''''''''''''''''''''''''''''''''''''''
  123. ''''''''''''''''''''''''''''''''''''''''''''''''''''''
  124. Dim retcode As Integer
  125. Dim retsemi As Double
  126. Dim retarea As Double
  127. retcode = Sides(Val(SideA.Text), Val(SideB.Text), Val(SideC.Text))
  128. If retcode <> 1 Then
  129.     MsgBox "INVALID TRIANGLE !!", 48, "Triangle"
  130.     SideA.Text = ""
  131.     SideB.Text = ""
  132.     SideC.Text = ""
  133.     Semi.Text = ""
  134.     Area.Text = ""
  135.     SideA.SetFocus
  136.     Exit Sub
  137. End If
  138. retsemi = SemiPer(Val(SideA.Text), Val(SideB.Text), Val(SideC.Text))
  139. retarea = TrArea(Val(SideA.Text), Val(SideB.Text), Val(SideC.Text))
  140. Semi.Text = Str$(retsemi)
  141. Area.Text = Str$(retarea)
  142. End Sub
  143. Sub Command2_Click ()
  144.     SideA.Text = ""
  145.     SideB.Text = ""
  146.     SideC.Text = ""
  147.     Semi.Text = ""
  148.     Area.Text = ""
  149.     SideA.SetFocus
  150. End Sub
  151. Sub MenExit_Click ()
  152. End Sub
  153.